import { seckList } from "@/request/api"

const state = {
    seckilllist: []
}

const getters = {
    getSeckill(state) {
        return state.seckilllist
    }
}

const mutations = {
    REQ_SECKILL(state, payload) {
        state.seckilllist = payload
    }
}

const actions = {
    changeSeckillAction({ commit }) {
        seckList().then(res => {
            console.log(res, '秒杀列表');
            commit('REQ_SECKILL', res.list)
        })
    }
}

export default {
    state,
    getters,
    mutations,
    actions,
    namespaced: true
}
